package interfaces;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.LinkedList;

import javax.swing.JTextArea;

import abstractions.AtomId;
import abstractions.ClientServices;
import abstractions.CommandC;



public class ClientServicesStub extends UnicastRemoteObject implements ClientServices {
	
	private JTextArea log;
	
	protected ClientServicesStub(JTextArea l) throws RemoteException {
		super();
		log = l;
		// TODO Auto-generated constructor stub
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public boolean lockAtom(int serverId, int docId, AtomId aId, int userId)
			throws RemoteException {
		// TODO Auto-generated method stub
		log.append("lockAtom (" + serverId +","+ docId +"," + aId +"," + userId + ")\n");
		return true;
	}

	@Override
	public boolean unlockAtom(int serverId, int docId, AtomId aId)
			throws RemoteException {
		// TODO Auto-generated method stub
		log.append("unlockAtom (" + serverId +","+ docId +"," + aId + ")\n");
		return true;
	}

	@Override
	public boolean addClientToDoc(int serverId, int docId, int userId)
			throws RemoteException {
		// TODO Auto-generated method stub
		log.append("addClientToDoc(" + serverId +","+ docId +"," + userId + ")\n");
		return true;
	}

	@Override
	public boolean removeClientFromDoc(int serverId, int docId, int userId)
			throws RemoteException {
		// TODO Auto-generated method stub
		log.append("removeClientFromDoc (" + serverId +","+ docId +"," +  userId + ")\n");
		return false;
	}

	@Override
	public boolean updateDoc(int serverId, int docId, LinkedList<CommandC> cmds)
			throws RemoteException {
		// TODO Auto-generated method stub
		log.append("updateDoc (" + serverId +","+ docId +"," + cmds.toString()+")\n");
		return false;
	}

	@Override
	public void updateServerFreq(int serverId, int serverFreq)
			throws RemoteException {
		log.append("updateServerFreq(" + serverId +","+ serverFreq + ")\n");
		// TODO Auto-generated method stub
		
	}




}
